home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / dhg_100.zip / INSTALL.CMD < prev    next >
OS/2 REXX Batch file  |  1997-05-29  |  2KB  |  86 lines

  1. /* REXX file to install the DH-Grep-PM on the deskop     */
  2. /* if you use this script as a starting point for your   */
  3. /* own install script and make improvements, please send */
  4. /* me a copy ---  dwhawk@southwind.net                   */
  5.  
  6. call rxfuncadd 'sysloadfuncs', 'rexxutil', 'sysloadfuncs'
  7. call sysloadfuncs                /* register system functions */
  8. address cmd '@echo off'          /* echo is turned off */
  9.  
  10. call SysCLS
  11.  
  12. say "DH-Grep-PM installation"
  13. say "Enter destination drive and directory"
  14. say "for example C:\OS2\APPS"
  15. say "to install in the curent directory just press enter"
  16.  
  17. pull dest
  18. call setup_dir(dest) 
  19. call copy_files
  20. call MKOBJ
  21. exit
  22.  
  23. check_ok:
  24.   say  'Okay to continue(Y/n) ? '        
  25.   k = SysGetKey('NOECHO') 
  26.   if k = 'Y' | k = 'y'  then return
  27.   say 'halting'
  28.     exit
  29.   end
  30.  
  31.  
  32. mkdir:  /* Procedure for creating dir */
  33.   Parse Arg dir
  34.   rc = SysMkDir(dir)
  35.   If (rc = 0 | rc = 5) Then Return
  36.   Say 'Problem creating destination directory "'dir'"'
  37.   Exit
  38.  
  39.  
  40. MKOBJ:
  41. Settings = 'EXENAME='direct||'\dhgreppm.exe;'
  42. Settings = Settings||'PROGTYPE=PM;MINIMIZED=NO;'
  43. Settings = Settings||'CCVIEW=YES;'
  44. Settings = Settings||'STARTUPDIR='||direct';'
  45. rc=SysCreateObject('WPProgram','DH-Grep-PM','<WP_DESKTOP>',Settings,'R');
  46.  
  47. if rc = 1 then Say "DH-Grep-PM installed on desktop"
  48. return
  49. end
  50.  
  51. setup_dir:      /* accept install path and create it if needed */
  52.                 /* the desired install path is in ARG(1) */
  53.                 /* if no path is specified current directory is used*/
  54.  
  55. Parse Arg destin  /* parameter of setup_dir */
  56.  
  57. save_dest = destin    /*  save original destin to */
  58.                       /*  determine if copy needed */
  59.  
  60. If destin = "" Then destin = Directory()
  61.  
  62. Say "Shall I install in "destin" ?"
  63. Call Check_Ok  /* your check routine */
  64.  
  65. Parse Var destin direct ':\' destin   /* get drive name only */
  66. direct=direct':'
  67.  
  68. Do Until destin = ""     /* No matter how many sub dirs present */
  69.   Parse Var destin sub '\' destin
  70.   direct=direct'\'sub
  71.   Call mkdir direct
  72. End
  73. return
  74.  
  75. copy_files:
  76. if save_dest \= ""  then do
  77.    'COPY dhgreppm.exe' direct
  78.    'COPY dhgreppm.hlp' direct
  79.    'COPY dhgreppm.doc' direct
  80.    'COPY edit_cmd.cmd' direct
  81.    'COPY _order.frm' direct
  82.  
  83. end
  84. return
  85. end
  86.